import { createRouter, createWebHashHistory } from 'vue-router';
import Home from '../../src/Index';
import SelfDo from '../admin/SelfDo';
import { navData } from '@/untils/nav';
import Gonggao from '@/gonggao/gonggao.vue';
import Xiangqing from '@/gonggao/xiangqing.vue';
import weigui from '@/weigui/weigui.vue';
import checkxq from '@/weigui/checkxq.vue';
import PlatformDynamicsPlus from '@/pingtai/PlatformDynamicsPlus.vue';
import PoliciesRegulationsPlus from '@/fagui/PoliciesRegulationsPlus.vue';

const routes = [
    {
        path: '/PoliciesRegulationsPlus/:id',
        name: 'PoliciesRegulationsPlus',
        component: PoliciesRegulationsPlus,
    },
    {
        path: '/PlatformDynamicsPlus/:id',
        name: 'PlatformDynamicsPlus',
        component: PlatformDynamicsPlus,
    },
    {
        path: '/home',
        name: 'Home',
        component: Home,
    },
    {
        path: '/selfdo',
        name: 'SelfDo',
        component: SelfDo,
        children: [
            {
                path: 'company-info',
                name: 'CompanyInfo',
                component: () => import('../admin/CompanyInfo'),
                meta: { breadcrumb: '企业信息', showRouterView: true}
            },
            {
                path: 'participate-bids',
                name: 'ParticipateBids',
                component: () => import('../admin/ParticipateBids.vue'),
                meta: { breadcrumb: '参与投标' , showRouterView: true}
            },
            {
                path: 'my-bids',
                name: 'MyBids',
                component: () => import('../admin/MyBids.vue'),
                meta: { breadcrumb: '我的投标' , showRouterView: true}
            },
            
            {
                path: 'tender-documents',
                name: 'TenderDocuments',
                component: () => import('../admin/TenderDocuments.vue'),
                meta: { breadcrumb: '我的标的' , showRouterView: true}
            }
        ]
    },
    {
        path: '/gonggao',
        name: 'gonggao',
        component: Gonggao
      },
      {
        path: '/xiangqing/:id',
        name: 'xiangqing',
        component: Xiangqing
      },
      {
        path: '/weigui',
        name: 'weigui',
        component: weigui
      },
      {
        path: '/checkxq',
        name: 'checkxq',
        component: checkxq
      },
];


navData.forEach(element => {
    routes.push({
        path: element.path,
        name: element.name,
        component: () => import(`../${element.component}`)
    });
});

const router = createRouter({
    history: createWebHashHistory(),
    routes
});

export default router;